Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use zustand store inside suspense fetch store to track progress #1693

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

axelboc
Copy link
Contributor

@axelboc axelboc commented Aug 8, 2024

This replaces the pub-sub pattern I had implemented in DataProviderApi, and considerably simplifies subscribing to the progress state in ValueLoader.

Basically, every fetch store now initialises a zustand store to track progress. Each "fetch input" (e.g. dataset+selection for valuesStore) is associated with a progress percentage in the zustand store, and the store can be subscribed to with zustand's useStore hook.

packages/app/src/providers/api.ts Show resolved Hide resolved
packages/app/src/providers/mock/mock-api.ts Show resolved Hide resolved
packages/app/src/vis-packs/ValueLoader.tsx Show resolved Hide resolved
packages/shared/package.json Show resolved Hide resolved
@axelboc axelboc requested a review from loichuder August 8, 2024 12:03
@axelboc axelboc merged commit 641f32a into main Aug 20, 2024
8 checks passed
@axelboc axelboc deleted the progress-store branch August 20, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants